package org.jetnuke.modules.jforum;

import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletResponse;

import net.jforum.ActionServletRequest;

import org.apache.velocity.VelocityContext;
import org.jetnuke.common.IAdminInfo;
import org.jetnuke.common.ICustomModule;
import org.jetnuke.common.IUserInfo;

public class JForumBaseModule implements ICustomModule {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger
			.getLogger(JForumBaseModule.class);

	public boolean[] service(ActionServletRequest request1,
			HttpServletResponse response, StringBuffer sb, VelocityContext vc,
			IUserInfo userInfo, IAdminInfo adminInfo, boolean isIndex,
			long time_init) throws Exception {
		if (logger.isDebugEnabled()) {
			logger
					.debug("service(ActionServletRequest, HttpServletResponse, StringBuffer, VelocityContext, IUserInfo, IAdminInfo, boolean, long) - start"); //$NON-NLS-1$
		}

		String sReturn = Utils.jforumService(request1, response);

		boolean bReturn[] = new boolean[2];
		bReturn[0] = true;
		bReturn[1] = true;
		if (sReturn == null) {
			bReturn[0] = false;// Do not continue!
		} else {
			sb.append(sReturn);
		}

		if (logger.isDebugEnabled()) {
			logger
					.debug("service(ActionServletRequest, HttpServletResponse, StringBuffer, VelocityContext, IUserInfo, IAdminInfo, boolean, long) - end"); //$NON-NLS-1$
		}
		return bReturn;

	}

}
